

public class TestGravity {

	/**
	 * @param args
	 */
	public static void main(String[] args) 
	{
	    //create new jumpable object
		MyObject martian = new MyObject(6, 10, 100, 30);
		
		//call jump method on object
		ObjectJump(martian);
		
	}
	
	protected static void ObjectJump(MyObject jumpingObject)
	{
		//a 0< jumping force means object is not able to jump
		if(jumpingObject.GetJumpingForce() > 0)
		{
			boolean continueLoop = true;
			double originalY = jumpingObject.GetCoordinates().GetYCoordinate();
			int loopCount = 0;
			System.out.print(String.format("Object Origin Coordinates: (%d, %d)", jumpingObject.GetCoordinates().GetXCoordinate(), jumpingObject.GetCoordinates().GetYCoordinate()));
			

			
			//calculate initial velocity value for jump (positive, hopefully)
			
			while(continueLoop)
			{
				++loopCount;
				
				System.out.print(String.format("Loop %i, Coordinates: (%d, %d)", loopCount, jumpingObject.GetCoordinates().GetXCoordinate(), jumpingObject.GetCoordinates().GetYCoordinate()));
				
				//apply acceleration as it decreases to zero and becomes negative
				
				if(jumpingObject.GetCoordinates().GetYCoordinate() <= originalY)
				{
				  //so we exit, eventually
				  continueLoop = false;
				}
				
			}
			
			System.out.print(String.format("Object hit the ground. Coordinates: (%d, %d)", jumpingObject.GetCoordinates().GetXCoordinate(), jumpingObject.GetCoordinates().GetYCoordinate()));
			
		}
	}

}
